﻿<Window x:Class="CodeExplorer"
        x:Name="CodeExplorer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:local="clr-namespace:InteropTest"
    xmlns:datatools="clr-namespace:DataTools.Interop;assembly=DTInterop"
    Title="HID Code Explorer"  Height="500" Width="810">

    <Grid VerticalAlignment="Stretch" 
          HorizontalAlignment="Stretch" 
          ShowGridLines="False" 
          Width="{Binding}" 
          Height="{Binding}"  
          Background="{DynamicResource PrgGradient}">

        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="20" />
            <RowDefinition Height="20"/>
            <RowDefinition x:Name="CenterRow" Height="{Binding}" />
            <RowDefinition Height="20" />
        </Grid.RowDefinitions>
        <Grid.Resources>
    
        </Grid.Resources>

        <Menu x:Name="menuBar" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="20" Grid.Row="0" Grid.ColumnSpan="3">
            <MenuItem x:Name="fileMenu" Header="_File" >
                <MenuItem.Items>
                    <MenuItem Header="_Close Window" x:Name="_Close" />
                    <MenuItem Header="_Stop Watching Device" x:Name="_Stop" />
                    <MenuItem Header="_Quit" x:Name="_Quit" />
                </MenuItem.Items>
            </MenuItem>
        </Menu>

        <ComboBox ItemsSource="{Binding ElementName=CodeExplorer,Path=Devices}" 
                  Grid.Row="1"
                  x:Name="DeviceSelect"
                  />
        
        <ListView
            x:Name="ViewingArea"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Width="{Binding}"
            Height="{Binding}"
            ItemsSource="{Binding ElementName=ProgramList,Path=SelectedItem.Items}"
            Grid.Row="2"
            Grid.Column="0"
            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
            Background="{x:Null}">
            <ListView.Resources>
                <Style TargetType="ListViewItem">
                    <Setter Property="Height" Value="32" />
                </Style>
            </ListView.Resources>

            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel 
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        Orientation="Horizontal"
                        ItemWidth="150"                
                        />

                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
        </ListView>
        <Grid Grid.Column="3" Grid.Row="3">

            <TextBox x:Name="Status" Text="Ready" />

        </Grid>

    </Grid>
</Window>
